{"ast":null,"code":"import { unstable_capitalize as capitalize } from '@mui/utils';\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nexport function getPath(obj, path) {\n  let checkVars = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n  if (!path || typeof path !== 'string') {\n    return null;\n  }\n\n  // Check if CSS variables are used\n  if (obj && obj.vars && checkVars) {\n    const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);\n    if (val != null) {\n      return val;\n    }\n  }\n  return path.split('.').reduce((acc, item) => {\n    if (acc && acc[item] != null) {\n      return acc[item];\n    }\n    return null;\n  }, obj);\n}\nexport function getStyleValue(themeMapping, transform, propValueFinal) {\n  let userValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : propValueFinal;\n  let value;\n  if (typeof themeMapping === 'function') {\n    value = themeMapping(propValueFinal);\n  } else if (Array.isArray(themeMapping)) {\n    value = themeMapping[propValueFinal] || userValue;\n  } else {\n    value = getPath(themeMapping, propValueFinal) || userValue;\n  }\n  if (transform) {\n    value = transform(value, userValue);\n  }\n  return value;\n}\nfunction style(options) {\n  const {\n    prop,\n    cssProperty = options.prop,\n    themeKey,\n    transform\n  } = options;\n  const fn = props => {\n    if (props[prop] == null) {\n      return null;\n    }\n    const propValue = props[prop];\n    const theme = props.theme;\n    const themeMapping = getPath(theme, themeKey) || {};\n    const styleFromPropValue = propValueFinal => {\n      let value = getStyleValue(themeMapping, transform, propValueFinal);\n      if (propValueFinal === value && typeof propValueFinal === 'string') {\n        // Haven't found value\n        value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n      }\n      if (cssProperty === false) {\n        return value;\n      }\n      return {\n        [cssProperty]: value\n      };\n    };\n    return handleBreakpoints(props, propValue, styleFromPropValue);\n  };\n  fn.propTypes = process.env.NODE_ENV !== 'production' ? {\n    [prop]: responsivePropType\n  } : {};\n  fn.filterProps = [prop];\n  return fn;\n}\nexport default style;","map":{"version":3,"names":["unstable_capitalize","capitalize","responsivePropType","handleBreakpoints","getPath","obj","path","checkVars","vars","val","split","reduce","acc","item","getStyleValue","themeMapping","transform","propValueFinal","userValue","value","Array","isArray","style","options","prop","cssProperty","themeKey","fn","props","propValue","theme","styleFromPropValue","propTypes","process","env","NODE_ENV","filterProps"],"sources":["/data/messenger.client/node_modules/@mui/system/esm/style.js"],"sourcesContent":["import { unstable_capitalize as capitalize } from '@mui/utils';\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nexport function getPath(obj, path, checkVars = true) {\n  if (!path || typeof path !== 'string') {\n    return null;\n  }\n\n  // Check if CSS variables are used\n  if (obj && obj.vars && checkVars) {\n    const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);\n    if (val != null) {\n      return val;\n    }\n  }\n  return path.split('.').reduce((acc, item) => {\n    if (acc && acc[item] != null) {\n      return acc[item];\n    }\n    return null;\n  }, obj);\n}\nexport function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {\n  let value;\n  if (typeof themeMapping === 'function') {\n    value = themeMapping(propValueFinal);\n  } else if (Array.isArray(themeMapping)) {\n    value = themeMapping[propValueFinal] || userValue;\n  } else {\n    value = getPath(themeMapping, propValueFinal) || userValue;\n  }\n  if (transform) {\n    value = transform(value, userValue);\n  }\n  return value;\n}\nfunction style(options) {\n  const {\n    prop,\n    cssProperty = options.prop,\n    themeKey,\n    transform\n  } = options;\n  const fn = props => {\n    if (props[prop] == null) {\n      return null;\n    }\n    const propValue = props[prop];\n    const theme = props.theme;\n    const themeMapping = getPath(theme, themeKey) || {};\n    const styleFromPropValue = propValueFinal => {\n      let value = getStyleValue(themeMapping, transform, propValueFinal);\n      if (propValueFinal === value && typeof propValueFinal === 'string') {\n        // Haven't found value\n        value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n      }\n      if (cssProperty === false) {\n        return value;\n      }\n      return {\n        [cssProperty]: value\n      };\n    };\n    return handleBreakpoints(props, propValue, styleFromPropValue);\n  };\n  fn.propTypes = process.env.NODE_ENV !== 'production' ? {\n    [prop]: responsivePropType\n  } : {};\n  fn.filterProps = [prop];\n  return fn;\n}\nexport default style;"],"mappings":"AAAA,SAASA,mBAAmB,IAAIC,UAAU,QAAQ,YAAY;AAC9D,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,iBAAiB,QAAQ,eAAe;AACjD,OAAO,SAASC,OAAO,CAACC,GAAG,EAAEC,IAAI,EAAoB;EAAA,IAAlBC,SAAS,uEAAG,IAAI;EACjD,IAAI,CAACD,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IACrC,OAAO,IAAI;EACb;;EAEA;EACA,IAAID,GAAG,IAAIA,GAAG,CAACG,IAAI,IAAID,SAAS,EAAE;IAChC,MAAME,GAAG,GAAI,QAAOH,IAAK,EAAC,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,MAAM,CAAC,CAACC,GAAG,EAAEC,IAAI,KAAKD,GAAG,IAAIA,GAAG,CAACC,IAAI,CAAC,GAAGD,GAAG,CAACC,IAAI,CAAC,GAAG,IAAI,EAAER,GAAG,CAAC;IACrG,IAAII,GAAG,IAAI,IAAI,EAAE;MACf,OAAOA,GAAG;IACZ;EACF;EACA,OAAOH,IAAI,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,MAAM,CAAC,CAACC,GAAG,EAAEC,IAAI,KAAK;IAC3C,IAAID,GAAG,IAAIA,GAAG,CAACC,IAAI,CAAC,IAAI,IAAI,EAAE;MAC5B,OAAOD,GAAG,CAACC,IAAI,CAAC;IAClB;IACA,OAAO,IAAI;EACb,CAAC,EAAER,GAAG,CAAC;AACT;AACA,OAAO,SAASS,aAAa,CAACC,YAAY,EAAEC,SAAS,EAAEC,cAAc,EAA8B;EAAA,IAA5BC,SAAS,uEAAGD,cAAc;EAC/F,IAAIE,KA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